Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 15, 2025

The build command now deletes all contents of the output directory before generating the site. This prevents stale artifacts from previous builds lingering in the output.

Changes

  • Version: Bumped to 0.14.0 to reflect behavioral change
  • Build process: Added ClearOutputDirectory() method that runs before content processing
    • Recursively deletes all files and subdirectories in the configured output path
    • Clears read-only attributes when needed
    • Logs warnings on individual failures but continues build
    • Gracefully handles missing directories
  • Documentation: Updated CLI docs to note the clearing behavior

Example

$ chloroplast build
Clearing output directory: /path/to/out
Output directory cleared successfully
Using build version for cache busting: 20251215221702
Processing area: source
...

Before this change, artifacts like renamed files, deleted pages, or temporary files would persist across builds. Now each build starts with a clean slate.

Original prompt

This section details on the original issue you should resolve

<issue_title>Build Subcommand should clear the out folder of any non-standard pieces of content</issue_title>
<issue_description>the build subcommand could just delete the contents of the out folder before running the build</issue_description>

<agent_instructions>make sure to update the build from 0.13 to 0.14 since this represents a change in behavior. Update the docs accordingly to mention this new behavior (but this doesn't need an extravagant set of documentation, just a mention in the cli's section on build that says the out folder will be cleared before building</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 15, 2025 22:17
- Updated version from 0.13.0 to 0.14.0
- Added ClearOutputDirectory method to clear all contents of out folder before build
- Updated CLI documentation to mention the new clearing behavior
- Added comprehensive tests for the clearing functionality
- Verified changes work correctly with manual testing

Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
- Added per-file/per-directory error handling with informative messages
- Clear read-only attribute before attempting file deletion
- Continue clearing even if individual files/directories fail

Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
Copilot AI changed the title [WIP] Update build subcommand to clear out folder before build Build command clears output directory before building (v0.14) Dec 15, 2025
Copilot AI requested a review from joelmartinez December 15, 2025 22:22
@joelmartinez joelmartinez marked this pull request as ready for review December 27, 2025 03:45
@joelmartinez joelmartinez merged commit 58db992 into main Dec 27, 2025
2 checks passed
@joelmartinez joelmartinez deleted the copilot/update-build-command-behavior branch December 27, 2025 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Subcommand should clear the out folder of any non-standard pieces of content

2 participants